from django.contrib.auth.models import User
from django.shortcuts import render
from django.http import HttpResponse
from user.models import *

# 视图函数views
def index(request):
    pass
    # # 返回响应Response
    # return HttpResponse('Hello Django!')

    # 渲染模版render，渲染html
    return render(request, 'index.html')


# 视图函数2
def index2(request):
    return HttpResponse('Index2')


def get_users(request):
    # 模型操作：获取所有用户
    users = UserModel.objects.all()
    return render(request,'user.html', {'users': users})